home *** CD-ROM | disk | FTP | other *** search
- #
- # Table creation testing
- #
-
- # OK : normal, simple table covering simple types
-
- create table staff (
- first_name char(10),
- last_name char(10),
- dept char(10),
- staff_id int,
- height real
- )\p\g
-
-
-
- # OK : table with text field and not null
-
- create table contact (
- staff_id int not null,
- phone char(15),
- address text(20)
- )\p\g
-
-
- # OK : table with non-basic types
-
- create table pay (
- staff_id int,
- pay_date date,
- pay_time time,
- pay_amount money
- )\p\g
-
-
-
- # OK : another simple table for use in 3-way joins
-
- create table users (
- staff_id int,
- uname char(15)
- )\p\g
-
-
-
- # ERROR : Non-Unique table name
-
- create table staff (
- staff_id int
- )\p\g
-
-
-
- # ERROR : Non-Unique field name
-
- create table fail (
- staff_id int,
- staff_id int
- )\p\g
-
-
-
- # ERROR : Too many fields
-
- create table fail (
- f1 int, f2 int, f3 int, f4 int, f5 int,
- f6 int, f7 int, f8 int, f9 int, f10 int,
- f11 int, f12 int, f13 int, f14 int, f15 int,
- f16 int, f17 int, f18 int, f19 int, f20 int,
- f21 int, f22 int, f23 int, f24 int, f25 int,
- f26 int, f27 int, f28 int, f29 int, f30 int,
- f31 int, f32 int, f33 int, f34 int, f35 int,
- f36 int, f37 int, f38 int, f39 int, f40 int,
- f41 int, f42 int, f43 int, f44 int, f45 int,
- f46 int, f47 int, f48 int, f49 int, f50 int,
- f51 int, f52 int, f53 int, f54 int, f55 int,
- f56 int, f57 int, f58 int, f59 int, f60 int,
- f61 int, f62 int, f63 int, f64 int, f65 int,
- f66 int, f67 int, f68 int, f69 int, f70 int,
- f71 int, f72 int, f73 int, f74 int, f75 int,
- f76 int, f77 int, f78 int, f79 int, f80 int,
- f81 int, f82 int, f83 int, f84 int, f85 int,
- f86 int, f87 int, f88 int, f89 int, f90 int
- )\p\g
-
-